﻿@{
    ViewBag.Title = "盘点输入";
    Layout = "~/Views/Shared/_ManufactureList.cshtml";
}

<script>
    $(function () {
        initControl();
    });

    function initControl() {
        gridList();

        //盘点单位
        $("#txtFHappenComNO").bindSelect({
            url: "/BaseData/ZSJ_B1_GH_SI/GetGridJson?isProduct=1",
            id: "UnitNO",
            search: true,
            text: "UnitNOShortName"
        });

        //发生方式
        $("#txtFDocuTypeNO").bindSelect({
            url: "/VBaseData/V_BUS_SJ_Dictionary/GetWayNodesForNotice",
            id: "FTypeNO",
            text: "FTypeName"
        });
        $("#txtFCurDate").val(new Date().format("yyyy-MM-dd"));
        $("#txtFDocuNO").val("CYCP201707-*******");
    }

    function btn_Return() {
        parent.$.reload();
        parent.$.detailClose();
    }

    function btn_Add() {
        $.modalOpen({
            id: "Form",
            title: '请输入盘点单据信息:',
            url: "/WareHouse/EnterWareHouse/InventoryOrderInfo?FDocuNO=" + $("#txtFDocuNO").val(),
            width: "730px",
            height: "600px",
            callBack: function (iframeId) {
                var data = top.frames[iframeId].Save();
                Query(data);
            }
        });
    }
    function Query(data) {
        $("#form1").formSerialize(data,"txt");
        $("#gridList").jqGrid('setGridParam', {
            postData: { fdocuNO: $("#txtFDocuNO").val() },
        }).trigger('reloadGrid');
    }
    function gridList() {
        var $gridList = $("#gridList");
        $gridList.dataGrid({
            url:"/VBaseData/V_CPK_42_MX_StoCPKListAcco/GetInStockOrder",
            height: $(window).height() - 240,
            postData: { fdocuNO: $("#txtFDocuNO").val() },
            colModel:[
                    { label: "id", name: "FRegisterID", width: 120, align: 'center', hidden: true,frozen: true },
                    { label: '零件分类编码', name: 'FProductionTypeNO', width: 100, align: 'center', frozen: true },
                    { label: '零件分类名称', name: 'FProductionTypeName', width: 100, align: 'center', hidden: true, frozen: true },
                    { label: '零件编号', name: 'FProductionNO', width: 170, align: 'center', frozen: true },
                    { label: '零件名称', name: 'FProductionName', width: 140, align: 'center', frozen: true },
                    { label: '仓库编号', name: 'FStoreNO', width: 100, align: 'center', frozen: true },
                    { label: '仓库名称', name: 'FStoreName', width: 80, align: 'center', hidden: true, frozen: true },
                    { label: '定置编号', name: 'FStoreSetNO', width: 100, align: 'center', frozen: true },
                    { label: '开票数量', name: 'FQuantity_KP', width: 60, align: 'center', frozen: true },
                    { label: '实际数量', name: 'FQuantity', width: 80, align: 'center', frozen: true },
                    { label: '零件单价(元)', name: 'FPrice_Settle', width: 80, align: 'center', frozen: true },
                    { label: '金额(元)', name: 'FAmount', width: 60, align: 'center' },
                    { label: '批次号', name: 'FBatchNo', width: 140, align: 'center' },
                    { label:'制造单位', name:'FProCompanyNO', width:80, align:'left' },
                    { label: '制造单位名称', name: 'FProCompanyName', width: 100, align: 'left',hidden: true },
                    { label: '容器编号', name: 'FContainerNO', width: 100, align: 'center' },
                    { label: '实际装箱数', name: 'FFactContent', width: 60, align: 'center' },
                    { label: '标准装箱数', name: 'FContent', width: 60, align: 'center' },
                    { label:'容器名称', name:'FContainerName', width:80, align:'center' },
                    { label:'容器数量', name:'FContainerQuantity', width:60, align:'center' },
                    { label: '托盘编号', name: 'FPalletNO', width: 60, align: 'left' },
                    { label: '托盘实际容量', name: 'FPalletFactContent', width: 100, align: 'left' },
                    { label: '托盘标准容量', name: 'FPalletContent', width: 100, align: 'left' },
                    { label:'托盘数量', name:'FPalletQuantity', width:60, align:'left' }
            ],
            viewrecords: true,
            frozen: true
        });
    }
</script>

<div class="ui-layout" id="layout" style="height:100%; width:100%;">
    <div class="ui-layout-center">
        <form id="form1">
            <div>
                <table class="form" style="width:97%;text-align:left;margin:0px;margin-top:-20px;margin-bottom:-3px; border-bottom:2px solid #ccc;">
                    <tr>
                        <td style="width:97%; padding:5px 10px;">
                            <div class="btn-group" style="margin-left:500px;margin-bottom:-10px;">
                                <h2 style="font-family:隶书;font-weight:bold;font-size:26px">盘点单</h2>
                            </div>
                            <div class="btn-group" style="margin-left:470px;margin-bottom:-25px;">
                                <a id="" class="btn btn-primary center-block " onclick="btn_Add()"><span class="glyphicon glyphicon-ok"></span> 新增</a>
                            </div>
                            <div class="btn-group" style="margin-left:30px;margin-bottom:-25px;">
                                <a id="" class="btn btn-primary center-block  " onclick="btn_Return()"><span class="glyphicon glyphicon-remove"></span> 返回</a>
                            </div>
                        </td>
                    </tr>
                </table>
                <table class="form">
                    <tr>
                        <th class="formTitle" style="width:100px;">&nbsp;</th>
                        <td class="formValue" style="width:160px;">
                            &nbsp;
                        </td>
                        <th class="formTitle" style="width:100px;">&nbsp;</th>
                        <td class="formValue" style="width:120px;">
                            &nbsp;
                        </td>
                        <th class="formTitle" style="width:100px;">&nbsp;</th>
                        <td class="formValue" style="width:120px;">
                            &nbsp;
                        </td>
                        <th class="formTitle" style="width:100px;">&nbsp;</th>
                        <td class="formValue" style="width:120px;">
                            &nbsp;
                        </td>
                        <th class="formTitle" style="width:100px;">单据编号</th>
                        <td class="formValue" style="width:120px;">
                            <input id="txtFDocuNO" name="FDocuNO" type="text" class="form-control required  text-right" disabled="disabled" />
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle" style="width:100px;">盘点单位</th>
                        <td class="formValue" style="width:160px;">
                            <select id="txtFHappenComNO" name="FHappenComNO" class="form-control  required">
                                <option value="">==请选择==</option>
                            </select>
                        </td>
                        <th class="formTitle" style="width:120px;">到货批次</th>
                        <td class="formValue" style="width:100px;">
                            <input id="txtFBatchNo" name="FBatchNo" type="text" class="form-control  text-right" value="" />
                        </td>
                        <th class="formTitle" style="width:100px;">&nbsp;</th>
                        <td class="formValue" style="width:120px;">
                            &nbsp;
                        </td>
                        <th class="formTitle" style="width:100px;">&nbsp;</th>
                        <td class="formValue" style="width:120px;">
                            &nbsp;
                        </td>
                        <th class="formTitle" style="width:80px;">单据日期</th>
                        <td class="formValue" style="width:120px;height:20px;">
                            <input id="txtFCurDate" name="FCurDate" type="text" class="form-control required" value="" onfocus="WdatePicker()" />
                        </td>

                    </tr>
                    <tr>
                        <th class="formTitle" style="width:100px;">发生方式</th>
                        <td class="formValue" style="width:140px;">
                            <select id="txtFDocuTypeNO" name="FDocuTypeNO" class="form-control required">
                                <option value="">==请选择==</option>
                            </select>
                        </td>
                        <th class="formTitle" style="width:120px;">摘要说明</th>
                        <td class="formValue" style="width:160px;">
                            <input id="" type="text" class="form-control " value="" />
                        </td>
                        <th class="formTitle" style="width:100px;">&nbsp;</th>
                        <td class="formValue" style="width:120px;">
                            &nbsp;
                        </td>
                        <th class="formTitle" style="width:100px;">&nbsp;</th>
                        <td class="formValue" style="width:120px;">
                            &nbsp;
                        </td>
                        <th class="formTitle" style="width:80px;">凭证编号</th>
                        <td class="formValue" style="width:120px;height:20px;">
                            <input id="" type="text" class="form-control " />
                        </td>
                    </tr>
                </table>
            </div>
        </form>
        <br />
        <table id="gridList"></table>
        <div class="price-info">
            <table class="form" style="margin-left:60px;">
                <tr>
                    <th class="formTitle">制单员</th>
                    <td class="formValue">
                        <input type="text" class="form-control" value="" />
                    </td>
                    <th class="formTitle" style="width:60px;">仓库保管员</th>
                    <td class="formValue">
                        <input type="text" class="form-control" value="" />
                    </td>

                    <th class="formTitle">检查员</th>
                    <td class="formValue" style="padding-right:20px;">
                        <input type="text" class="form-control " value="" />
                    </td>
                    <th class="formTitle">输入日期</th>
                    <td class="formValue">
                        <input type="text" class="form-control " value="" />
                    </td>
                    <th class="formTitle">审核日期</th>
                    <td class="formValue" style="padding-right:20px;">
                        <input type="text" class="form-control" />
                    </td>
                    <th class="formTitle">检查日期</th>
                    <td class="formValue">
                        <input type="text" class="form-control " value="" />
                    </td>

                </tr>
            </table>
        </div>
    </div>
</div>